import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/landing',
        name: 'landing',
        component: () => import(/* webpackChunkName: "landing" */ '@views/Landing.vue'),
        meta: {
            title: '菲凡云代表'
        }
    },
    // {
    //     path: '/auth',
    //     name: 'auth',
    //     component: () => import(/* webpackChunkName: "landing" */ '@views/Auth.vue'),
    //     meta: {
    //         title: '菲凡云代表'
    //     }
    // },
    {
        path: '/auth',
        name: 'auth',
        component: () => import(/* webpackChunkName: "auth" */ '@views/Auth2.vue'),
        meta: {
            title: '获取授权'
        }
    },
    {
        path: '/callback',
        name: 'callback',
        component: () => import(/* webpackChunkName: "callback" */ '@views/callback.vue'),
        meta: {
            title: '授权中...'
        }
    },
    {
        path: '/ihub',
        name: 'ihub_index',
        component: () => import(/* webpackChunkName: "index" */ '@/App.vue'),
        children: [
            {
                path: 'auth',
                name: 'ihub_auth',
                component: () => import(/* webpackChunkName: "ihub_auth" */ '@views/ihub/auth.vue'),
                meta: {
                    title: '授权'
                }
            },
            {
                path: 'callback',
                name: 'ihub_callback',
                component: () => import(/* webpackChunkName: "ihub_callback" */ '@views/ihub/callback.vue'),
                meta: {
                    title: '回调'
                }
            },
        ]
    },
    {
        path: '/schedule',
        name: 'schedule_index',
        component: () => import(/* webpackChunkName: "index" */ '@/App.vue'),
        children: [
            {
                path: 'add',
                name: 'schedule_add',
                component: () => import(/* webpackChunkName: "schedule_add" */ '@views/schedule/add/index.vue'),
                meta: {
                    title: '新建日程'
                }
            },
            {
                path: 'edit/:id',
                name: 'schedule_edit',
                component: () => import(/* webpackChunkName: "schedule_edit" */ '@views/schedule/edit/index.vue'),
                meta: {
                    title: '日程修改'
                }

            },
            {
                path: 'detail/:id',
                name: 'schedule_detail',
                component: () => import(/* webpackChunkName: "schedule_detail" */ '@views/schedule/detail/index.vue'),
                meta: {
                    title: '日程详情'
                }

            },
            {
                path: 'list',
                name: 'schedule_list',
                component: () => import(/* webpackChunkName: "schedule_list" */ '@views/schedule/list/indexList.vue'),
                meta: {
                    title: '日程列表'
                }

            }
        ]
    },
    {
        path: '/feedback',
        name: 'feedback_index',
        component: () => import(/* webpackChunkName: "feedback_index" */ '@/App.vue'),
        children: [
            {
                path: 'list',
                name: 'feedback_list',
                component: () => import(/* webpackChunkName: "feedback_list" */ '@views/feedback/list.vue'),
                meta: {
                    title: '报告列表'
                }

            },
            {
                path: 'detail',
                name: 'feedback_detail',
                component: () => import(/* webpackChunkName: "feedback_detail" */ '@views/feedback/detail.vue'),
                meta: {
                    title: '报告详情'
                }

            }
        ]

    },
    {
        path: '/dashboard',
        name: 'dashboard',
        component: () => import(/* webpackChunkName: "index" */ '@/App.vue'),
        children: [
            {
                path: 'MRProgress',
                name: 'MRProgress',
                component: () => import(/* webpackChunkName: "dashboard_MRProgress" */ '@views/dashboard/MRRM/MRProgress.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'dmprogress',
                name: 'dmprogress',
                component: () => import(/* webpackChunkName: "dashboard_MRProgress" */ '@views/dashboard/MRRM/DM.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'MRRM',
                name: 'MRRM',
                component: () => import(/* webpackChunkName: "dashboard_mr" */ '@views/dashboard/MRRM/index.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'customer',
                name: 'customer',
                component: () => import(/* webpackChunkName: "dashboard_customer" */ '@views/dashboard/PL/customer/index.vue'),
                meta: {
                    title: '客户分型'
                },

            },
            {
                path: 'customer-dmrm',
                name: 'customer_dmrm',
                component: () => import(/* webpackChunkName: "dashboard_customer" */ '@views/dashboard/PL/customer-dmrm/index.vue'),
                meta: {
                    title: '控制台'
                },

            },
            {
                path: 'pl',
                name: 'pl',
                component: () => import(/* webpackChunkName: "dashboard_pl" */ '@views/dashboard/PL/index.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'plStresspWrite',
                name: 'plStresspWrite',
                component: () => import(/* webpackChunkName: "dashboard_plStresspWrite" */ '@views/dashboard/PL/plStresspWrite.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'plStress',
                name: 'plStress',
                component: () => import(/* webpackChunkName: "dashboard_plStress" */ '@views/dashboard/PL/plStress.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'cu',
                name: 'cu',
                component: () => import(/* webpackChunkName: "dashboard_cu" */ '@views/dashboard/CU/index.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'dm',
                name: 'dm',
                component: () => import(/* webpackChunkName: "dashboard_dm" */ '@views/dashboard/DM/index.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'dm_confirmdetail',
                name: 'dm_confirmdetail',
                component: () => import(/* webpackChunkName: "dashboard_dm_confirmdetail" */ '@views/dashboard/DM/dmGroupConfirmDetail.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'dm_confirwxmdetail',
                name: 'dm_confirdm_confirwxmdetailmdetail',
                component: () => import(/* webpackChunkName: "dashboard_dm_confirwxmdetail" */ '@views/dashboard/DM/dmGroupConfirmWxDetail.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'dm_group',
                name: 'dm_group',
                component: () => import(/* webpackChunkName: "dashboard_dm_group" */ '@views/dashboard/DM/dmGroup.vue'),
                meta: {
                    title: '控制台'
                }
            },
            {
                path: 'bu',
                name: 'bu',
                component: () => import(/* webpackChunkName: "dashboard_bu" */ '@views/dashboard/BU/index.vue'),
                meta: {
                    title: '控制台'
                }
            }
        ]
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.NODE_ENV === 'production' ? '/frontend/' : process.env.BASE_URL,
    routes,
})

export default router